package com.muyi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyi.pojo.entity.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.List;

/**
* @author 33086
* @description 针对表【account】的数据库操作Mapper
* @createDate 2025-07-17 13:44:25
* @Entity com.muyi.pojo.entity.Account
*/
@Mapper
public interface AccountMapper extends BaseMapper<Account> {

    /**
     * 查询全部管理员
     * @return
     */
    @Select("select * from account")
    List<Account> list();

    /**
     * 根据ID删除管理员
     * @param account_id
     */
    @Delete("delete from account where account_id = #{account_id}")
    void deleteById(Integer account_id);

    /**
     * 新增管理员
     *
     * @param account
     * @return
     */
    int insertAll(Account account);

    /**
     * 更新管理员
     * @param account
     */

    void update(Account account);



    @Select("select * from account where account_id = #{account_id}")
    Account getByAccountId(Integer account_id);

    @Select("select * from account where accountname = #{accountname} and password = #{password}")
    Account getByAccountnameAndPassword(Account account);

    @Select("select * from account where accountname = #{accountname}")
    Account getByAccountname(Account account);

}




